/**
 *
 */
import OpenApi;
import OpenApi.OpenApiUtil;

extends OpenApi;


init(config: OpenApiUtil.Config){
  super(config);
  @signatureAlgorithm = 'v2';
  @endpointRule = 'regional';
  
  checkConfig(config);
  @endpoint = getEndpoint('eds-user', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!$isNull(endpoint)) {
    return endpoint;
  }
  
  if (!$isNull(endpointMap) && !$isNull(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return OpenApiUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model GroupResources {
  region?: string(name='Region'),
  resourceId?: string(name='ResourceId'),
  resourceType?: string(name='ResourceType'),
}

model ThirdApp {
  appKey?: string(name='AppKey'),
  name?: string(name='Name'),
  oidcSsoConfig?: {
    accessTokenEffectiveTime?: int32(name='AccessTokenEffectiveTime'),
    codeEffectiveTime?: int32(name='CodeEffectiveTime'),
    enableAuthLogin?: boolean(name='EnableAuthLogin'),
    endpoints?: {
      authorizationEndpoint?: string(name='AuthorizationEndpoint'),
      discoveryEndpoint?: string(name='DiscoveryEndpoint'),
      guestAuthorizationEndpoint?: string(name='GuestAuthorizationEndpoint'),
      issuer?: string(name='Issuer'),
      jwksEndpoint?: string(name='JwksEndpoint'),
      logoutEndpoint?: string(name='LogoutEndpoint'),
      revokeEndpoint?: string(name='RevokeEndpoint'),
      tokenEndpoint?: string(name='TokenEndpoint'),
      userinfoEndpoint?: string(name='UserinfoEndpoint'),
    }(name='Endpoints'),
    grantScopes?: [ string ](name='GrantScopes'),
    grantTypes?: [ string ](name='GrantTypes'),
    idTokenAlgorithmType?: string(name='IdTokenAlgorithmType'),
    idTokenEffectiveTime?: int32(name='IdTokenEffectiveTime'),
    redirectUris?: [ string ](name='RedirectUris'),
    refreshTokenEffective?: int32(name='RefreshTokenEffective'),
  }(name='OidcSsoConfig'),
  secrets?: [ 
    {
      enable?: boolean(name='Enable'),
      secret?: string(name='Secret'),
    }
  ](name='Secrets'),
}

model WaIdPermissions {
  code?: string(name='Code'),
  isBasicChild?: boolean(name='IsBasicChild'),
  name?: string(name='Name'),
  subPermissions?: [
    WaIdPermissions
  ](name='SubPermissions'),
  type?: string(name='Type'),
}

model BatchSetDesktopManagerRequest {
  isDesktopManager?: string(name='IsDesktopManager', example='1'),
  users?: [ string ](name='Users', description='This parameter is required.'),
}

model BatchSetDesktopManagerResponseBody = {
  requestId?: string(name='RequestId', example='868B8926-2E7A-5BE7-9897-E811E994****'),
}

model BatchSetDesktopManagerResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: BatchSetDesktopManagerResponseBody(name='body'),
}

/**
 * @summary 批量设置桌面管理员
 *
 * @param request BatchSetDesktopManagerRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return BatchSetDesktopManagerResponse
 */
async function batchSetDesktopManagerWithOptions(request: BatchSetDesktopManagerRequest, runtime: $RuntimeOptions): BatchSetDesktopManagerResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.isDesktopManager)) {
    body['IsDesktopManager'] = request.isDesktopManager;
  }
  if (!$isNull(request.users)) {
    body['Users'] = request.users;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'BatchSetDesktopManager',
    version = '2021-03-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 批量设置桌面管理员
 *
 * @param request BatchSetDesktopManagerRequest
 * @return BatchSetDesktopManagerResponse
 */
async function batchSetDesktopManager(request: BatchSetDesktopManagerRequest): BatchSetDesktopManagerResponse {
  var runtime = new $RuntimeOptions{};
  return batchSetDesktopManagerWithOptions(request, runtime);
}

model ChangeUserPasswordRequest {
  endUserId?: string(name='EndUserId', example='alice***'),
  newPassword?: string(name='NewPassword', example='Admin@12***'),
}

model ChangeUserPasswordResponseBody = {
  requestId?: string(name='RequestId', example='AA8D67CB-345D-5CDA-986E-FFAC7D0****'),
}

model ChangeUserPasswordResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ChangeUserPasswordResponseBody(name='body'),
}

/**
 * @summary 管理员修改用户密码
 *
 * @param request ChangeUserPasswordRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ChangeUserPasswordResponse
 */
async function changeUserPasswordWithOptions(request: ChangeUserPasswordRequest, runtime: $RuntimeOptions): ChangeUserPasswordResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.endUserId)) {
    body['EndUserId'] = request.endUserId;
  }
  if (!$isNull(request.newPassword)) {
    body['NewPassword'] = request.newPassword;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'ChangeUserPassword',
    version = '2021-03-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 管理员修改用户密码
 *
 * @param request ChangeUserPasswordRequest
 * @return ChangeUserPasswordResponse
 */
async function changeUserPassword(request: ChangeUserPasswordRequest): ChangeUserPasswordResponse {
  var runtime = new $RuntimeOptions{};
  return changeUserPasswordWithOptions(request, runtime);
}

model CheckUsedPropertyRequest {
  propertyId?: long(name='PropertyId', description='The ID of the property. You can call the [ListProperty](https://help.aliyun.com/document_detail/410890.html) operation to query the property ID.

This parameter is required.', example='390'),
}

model CheckUsedPropertyResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='22C97624-2405-54AC-BD44-A63FBE97CC2D'),
  useCount?: long(name='UseCount', description='The number of convenience users that are associated with the property.', example='7'),
}

model CheckUsedPropertyResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CheckUsedPropertyResponseBody(name='body'),
}

/**
 * @summary Queries whether a property is associated with one or more convenience users.
 *
 * @param request CheckUsedPropertyRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CheckUsedPropertyResponse
 */
async function checkUsedPropertyWithOptions(request: CheckUsedPropertyRequest, runtime: $RuntimeOptions): CheckUsedPropertyResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.propertyId)) {
    query['PropertyId'] = request.propertyId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'CheckUsedProperty',
    version = '2021-03-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries whether a property is associated with one or more convenience users.
 *
 * @param request CheckUsedPropertyRequest
 * @return CheckUsedPropertyResponse
 */
async function checkUsedProperty(request: CheckUsedPropertyRequest): CheckUsedPropertyResponse {
  var runtime = new $RuntimeOptions{};
  return checkUsedPropertyWithOptions(request, runtime);
}

model CheckUsedPropertyValueRequest {
  propertyId?: long(name='PropertyId', description='The property ID. You can call the [ListProperty](~~ListProperty~~) operation to query property ID.

This parameter is required.', example='380'),
  propertyValueId?: long(name='PropertyValueId', description='The ID of the property value. You can call the [ListProperty](~~ListProperty~~) operation to query the ID of the property value.

This parameter is required.', example='978'),
}

model CheckUsedPropertyValueResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='1CBAFFAB-B697-4049-A9B1-67E1FC5F****'),
  useCount?: long(name='UseCount', description='The number of convenience accounts that are associated with the specified custom property value.', example='1'),
}

model CheckUsedPropertyValueResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CheckUsedPropertyValueResponseBody(name='body'),
}

/**
 * @summary Queries the number of convenience accounts that are associated with the specified custom property value.
 *
 * @description Before you call the operation, you can call the [ListProperty](https://help.aliyun.com/document_detail/410890.html) operation to query the existing user properties and their IDs (PropertyId) and values (PropertyValueId).
 *
 * @param request CheckUsedPropertyValueRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CheckUsedPropertyValueResponse
 */
async function checkUsedPropertyValueWithOptions(request: CheckUsedPropertyValueRequest, runtime: $RuntimeOptions): CheckUsedPropertyValueResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.propertyId)) {
    query['PropertyId'] = request.propertyId;
  }
  if (!$isNull(request.propertyValueId)) {
    query['PropertyValueId'] = request.propertyValueId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'CheckUsedPropertyValue',
    version = '2021-03-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the number of convenience accounts that are associated with the specified custom property value.
 *
 * @description Before you call the operation, you can call the [ListProperty](https://help.aliyun.com/document_detail/410890.html) operation to query the existing user properties and their IDs (PropertyId) and values (PropertyValueId).
 *
 * @param request CheckUsedPropertyValueRequest
 * @return CheckUsedPropertyValueResponse
 */
async function checkUsedPropertyValue(request: CheckUsedPropertyValueRequest): CheckUsedPropertyValueResponse {
  var runtime = new $RuntimeOptions{};
  return checkUsedPropertyValueWithOptions(request, runtime);
}

model CreateOrgRequest {
  orgName?: string(name='OrgName', description='This parameter is required.'),
  parentOrgId?: string(name='ParentOrgId', description='This parameter is required.', example='org-evk12ozjvmlxl****'),
}

model CreateOrgResponseBody = {
  orgId?: string(name='OrgId', example='org-evk12ozjvmlxl****'),
  requestId?: string(name='RequestId', example='7A2C3803-C975-5871-A232-80A91009****'),
}

model CreateOrgResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateOrgResponseBody(name='body'),
}

/**
 * @summary 创建组织
 *
 * @param request CreateOrgRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateOrgResponse
 */
async function createOrgWithOptions(request: CreateOrgRequest, runtime: $RuntimeOptions): CreateOrgResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.orgName)) {
    query['OrgName'] = request.orgName;
  }
  if (!$isNull(request.parentOrgId)) {
    query['ParentOrgId'] = request.parentOrgId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateOrg',
    version = '2021-03-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 创建组织
 *
 * @param request CreateOrgRequest
 * @return CreateOrgResponse
 */
async function createOrg(request: CreateOrgRequest): CreateOrgResponse {
  var runtime = new $RuntimeOptions{};
  return createOrgWithOptions(request, runtime);
}

model CreatePropertyRequest {
  propertyKey?: string(name='PropertyKey', description='The property name.

This parameter is required.', example='department'),
  propertyValues?: [ string ](name='PropertyValues', description='The values of the property. You can specify up to 50 values for a property.'),
}

model CreatePropertyResponseBody = {
  createResult?: {
    propertyId?: long(name='PropertyId', description='The ID of the property.', example='390'),
    propertyKey?: string(name='PropertyKey', description='The name of the property.', example='department'),
    savePropertyValueModel?: {
      failedPropertyValues?: [ 
        {
          errorCode?: string(name='ErrorCode', description='The error code.', example='ExistedPropertyValue'),
          errorMessage?: string(name='ErrorMessage', description='The error message.', example='The property value is used by another property.'),
          propertyId?: long(name='PropertyId', description='The ID of the property value.', example='390'),
          propertyValue?: string(name='PropertyValue', description='The value of the property.', example='HR'),
        }
      ](name='FailedPropertyValues', description='The property values that failed to be created.'),
      savePropertyValues?: [ 
        {
          propertyValue?: string(name='PropertyValue', description='The value of the property.', example='HR'),
          propertyValueId?: long(name='PropertyValueId', description='The ID of the property value.', example='978'),
        }
      ](name='SavePropertyValues', description='Details of the property values that were created.'),
    }(name='SavePropertyValueModel', description='The result of creating the property value.'),
  }(name='CreateResult', description='The result of creating the property.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='1CBAFFAB-B697-4049-A9B1-67E1FC5F****'),
}

model CreatePropertyResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreatePropertyResponseBody(name='body'),
}

/**
 * @summary Creates a user property.
 *
 * @param request CreatePropertyRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreatePropertyResponse
 */
async function createPropertyWithOptions(request: CreatePropertyRequest, runtime: $RuntimeOptions): CreatePropertyResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.propertyKey)) {
    body['PropertyKey'] = request.propertyKey;
  }
  if (!$isNull(request.propertyValues)) {
    body['PropertyValues'] = request.propertyValues;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateProperty',
    version = '2021-03-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates a user property.
 *
 * @param request CreatePropertyRequest
 * @return CreatePropertyResponse
 */
async function createProperty(request: CreatePropertyRequest): CreatePropertyResponse {
  var runtime = new $RuntimeOptions{};
  return createPropertyWithOptions(request, runtime);
}

model CreateResourceGroupRequest {
  isResourceGroupWithOfficeSite?: long(name='IsResourceGroupWithOfficeSite', example='0'),
  platform?: string(name='Platform', example='AliyunConsole'),
  resourceGroupName?: string(name='ResourceGroupName'),
}

model CreateResourceGroupResponseBody = {
  requestId?: string(name='RequestId', example='868B8926-2E7A-5BE7-9897-E811E994****'),
  resourceGroupId?: string(name='ResourceGroupId', example='rg-ckf3cx7isinhk***'),
}

model CreateResourceGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateResourceGroupResponseBody(name='body'),
}

/**
 * @summary 创建资源组
 *
 * @param request CreateResourceGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateResourceGroupResponse
 */
async function createResourceGroupWithOptions(request: CreateResourceGroupRequest, runtime: $RuntimeOptions): CreateResourceGroupResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.isResourceGroupWithOfficeSite)) {
    query['IsResourceGroupWithOfficeSite'] = request.isResourceGroupWithOfficeSite;
  }
  if (!$isNull(request.platform)) {
    query['Platform'] = request.platform;
  }
  if (!$isNull(request.resourceGroupName)) {
    query['ResourceGroupName'] = request.resourceGroupName;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateResourceGroup',
    version = '2021-03-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 创建资源组
 *
 * @param request CreateResourceGroupRequest
 * @return CreateResourceGroupResponse
 */
async function createResourceGroup(request: CreateResourceGroupRequest): CreateResourceGroupResponse {
  var runtime = new $RuntimeOptions{};
  return createResourceGroupWithOptions(request, runtime);
}

model CreateUsersRequest {
  autoLockTime?: string(name='AutoLockTime', description='The date on which the convenience users are automatically locked.', example='2023-03-03'),
  isLocalAdmin?: boolean(name='IsLocalAdmin'),
  password?: string(name='Password', description='The initial password. If this parameter is left empty, an email for password reset is sent to the specified email address.', example='Test123****'),
  passwordExpireDays?: string(name='PasswordExpireDays'),
  users?: [ 
    {
      email?: string(name='Email', description='The email address of the convenience user. The email address is used to receive notifications about events such as desktop assignment. You must specify an email address or a mobile number to receive notifications.', example='username@example.com'),
      endUserId?: string(name='EndUserId', description='The username of the convenience user. The name can contain lowercase letters, digits, and underscores (_), and must be 3 to 24 characters in length.

This parameter is required.', example='test1'),
      orgId?: string(name='OrgId', description='The organization to which the convenience user belongs.', example='1111****'),
      ownerType?: string(name='OwnerType', description='The type of the account ownership.

Valid values:

*   CreateFromManager: administrator-activated
*   Normal: user-activated', example='Normal'),
      password?: string(name='Password', description='The user password.

>  The password must be at least 10 characters in length and contain at least three of the following character types: uppercase letters, lowercase letters, digits, and special characters (excluding spaces).', example='password1'),
      phone?: string(name='Phone', description='Mobile numbers are not supported on the international site (alibabacloud.com).', example='1381111****'),
      realNickName?: string(name='RealNickName', description='The display name of the end user.', example='Bean'),
      remark?: string(name='Remark', description='The remarks on the convenience user.', example='remark1'),
    }
  ](name='Users', description='The information about the convenience user.

This parameter is required.', example='CreateUsers'),
}

model CreateUsersResponseBody = {
  allSucceed?: boolean(name='AllSucceed'),
  createResult?: {
    createdUsers?: [ 
      {
        email?: string(name='Email', description='The email address of the end user.', example='username@example.com'),
        endUserId?: string(name='EndUserId', description='The name of the end user.', example='test1'),
        phone?: string(name='Phone', description='The mobile number of the end user.', example='1381111****'),
        realNickName?: string(name='RealNickName', description='The display name of the end user.', example='Bean'),
        remark?: string(name='Remark', description='The remarks of the end user.', example='remark1'),
      }
    ](name='CreatedUsers', description='Details of the created convenience users.'),
    failedUsers?: [ 
      {
        email?: string(name='Email', description='The email address of the end user.', example='username2@example.com'),
        endUserId?: string(name='EndUserId', description='The name of the end user.', example='test2'),
        errorCode?: string(name='ErrorCode', description='The error code returned if the request failed.', example='ExistedEndUserId'),
        errorMessage?: string(name='ErrorMessage', description='The error message returned.', example='The username test is used by another user.'),
        phone?: string(name='Phone', description='The mobile number of the end user.', example='1390000****'),
      }
    ](name='FailedUsers', description='Details of the convenience users that failed to be created.'),
  }(name='CreateResult', description='The result of user creation.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='1CBAFFAB-B697-4049-A9B1-67E1FC5F****'),
}

model CreateUsersResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateUsersResponseBody(name='body'),
}

/**
 * @summary Creates a convenience user.
 *
 * @description Convenience users are dedicated Elastic Desktop Service (EDS) user accounts and are suitable for scenarios in which you do not need to connect to enterprise Active Directory (AD) systems. The information about a convenience user includes the username, email address, and mobile number. You must specify the username or email address.
 *
 * @param request CreateUsersRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateUsersResponse
 */
async function createUsersWithOptions(request: CreateUsersRequest, runtime: $RuntimeOptions): CreateUsersResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.autoLockTime)) {
    query['AutoLockTime'] = request.autoLockTime;
  }
  if (!$isNull(request.isLocalAdmin)) {
    query['IsLocalAdmin'] = request.isLocalAdmin;
  }
  if (!$isNull(request.passwordExpireDays)) {
    query['PasswordExpireDays'] = request.passwordExpireDays;
  }
  var body : map[string]any = {};
  if (!$isNull(request.password)) {
    body['Password'] = request.password;
  }
  if (!$isNull(request.users)) {
    body['Users'] = request.users;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateUsers',
    version = '2021-03-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates a convenience user.
 *
 * @description Convenience users are dedicated Elastic Desktop Service (EDS) user accounts and are suitable for scenarios in which you do not need to connect to enterprise Active Directory (AD) systems. The information about a convenience user includes the username, email address, and mobile number. You must specify the username or email address.
 *
 * @param request CreateUsersRequest
 * @return CreateUsersResponse
 */
async function createUsers(request: CreateUsersRequest): CreateUsersResponse {
  var runtime = new $RuntimeOptions{};
  return createUsersWithOptions(request, runtime);
}

model DeleteResourceGroupRequest {
  resourceGroupId?: string(name='ResourceGroupId', example='rg-aj01tck67a0szp***'),
  resourceGroupIds?: [ string ](name='ResourceGroupIds'),
}

model DeleteResourceGroupResponseBody = {
  requestId?: string(name='RequestId', example='2463A343-BD32-5803-959E-9A8472A1***'),
}

model DeleteResourceGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteResourceGroupResponseBody(name='body'),
}

/**
 * @summary 删除资源组
 *
 * @param request DeleteResourceGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteResourceGroupResponse
 */
async function deleteResourceGroupWithOptions(request: DeleteResourceGroupRequest, runtime: $RuntimeOptions): DeleteResourceGroupResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!$isNull(request.resourceGroupIds)) {
    query['ResourceGroupIds'] = request.resourceGroupIds;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteResourceGroup',
    version = '2021-03-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 删除资源组
 *
 * @param request DeleteResourceGroupRequest
 * @return DeleteResourceGroupResponse
 */
async function deleteResourceGroup(request: DeleteResourceGroupRequest): DeleteResourceGroupResponse {
  var runtime = new $RuntimeOptions{};
  return deleteResourceGroupWithOptions(request, runtime);
}

model DeleteUserPropertyValueRequest {
  propertyId?: long(name='PropertyId', description='The property ID. You can call the [ListProperty](~~ListProperty~~) operation to query the property ID.

This parameter is required.', example='390'),
  propertyValueId?: long(name='PropertyValueId', description='The property value ID. You can call the [ListProperty](~~ListProperty~~) operation to query the property value ID.

This parameter is required.', example='978'),
  userId?: long(name='UserId', description='The user ID. You can call the [DescribeUsers](~~DescribeUsers~~) operation to query the user ID, which is the return value of the `Id` parameter.

This parameter is required.', example='123'),
}

model DeleteUserPropertyValueResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='D6C62E40-F937-5803-B008-92E813399BA5'),
}

model DeleteUserPropertyValueResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteUserPropertyValueResponseBody(name='body'),
}

/**
 * @summary Dissociates a user property from a user.
 *
 * @description Before you call this operation, you can call the FilterUsers operation to query the users that are associated with user properties.
 *
 * @param request DeleteUserPropertyValueRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteUserPropertyValueResponse
 */
async function deleteUserPropertyValueWithOptions(request: DeleteUserPropertyValueRequest, runtime: $RuntimeOptions): DeleteUserPropertyValueResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.propertyId)) {
    body['PropertyId'] = request.propertyId;
  }
  if (!$isNull(request.propertyValueId)) {
    body['PropertyValueId'] = request.propertyValueId;
  }
  if (!$isNull(request.userId)) {
    body['UserId'] = request.userId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteUserPropertyValue',
    version = '2021-03-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Dissociates a user property from a user.
 *
 * @description Before you call this operation, you can call the FilterUsers operation to query the users that are associated with user properties.
 *
 * @param request DeleteUserPropertyValueRequest
 * @return DeleteUserPropertyValueResponse
 */
async function deleteUserPropertyValue(request: DeleteUserPropertyValueRequest): DeleteUserPropertyValueResponse {
  var runtime = new $RuntimeOptions{};
  return deleteUserPropertyValueWithOptions(request, runtime);
}

model DescribeMfaDevicesRequest {
  adDomain?: string(name='AdDomain', description='The domain of the Active Directory (AD) workspace.', example='cn.misumi.pri'),
  endUserIds?: [ string ](name='EndUserIds', description='The usernames of the convenience users.', example='test'),
  maxResults?: long(name='MaxResults', description='The maximum number of entries to return. Valid values: 1 to 500.\\\\
Default value: 100.', example='100'),
  nextToken?: string(name='NextToken', description='The pagination token that is used in the next request to retrieve a new page of results. Set the value to the token that is obtained from the previous query.', example='caeba0bbb2be03f84eb48b699f0a4883'),
  serialNumbers?: [ string ](name='SerialNumbers', description='The serial numbers of the virtual MFA devices.', example='c2d9ae94-a64b-4a0d-8024-9519ca50****'),
}

model DescribeMfaDevicesResponseBody = {
  mfaDevices?: [ 
    {
      consecutiveFails?: int32(name='ConsecutiveFails', description='The number of consecutive failures to bind the virtual MFA device, or the number of authentication failures based on the virtual MFA device.', example='0'),
      deviceType?: string(name='DeviceType', description='The type of the virtual MFA device. The value can only be TOTP_VIRTUAL. This value indicates that the virtual MFA device follows the Time-based One-time Password (TOTP) algorithm.', example='TOTP_VIRTUAL'),
      email?: string(name='Email', description='>  This parameter is not publicly available.', example='username@example.com'),
      endUserId?: string(name='EndUserId', description='The username of the convenience user that uses the virtual MFA device.', example='test'),
      gmtEnabled?: string(name='GmtEnabled', description='The time when the virtual MFA device was enabled. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.', example='2021-06-22T06:20:49Z'),
      gmtUnlock?: string(name='GmtUnlock', description='The time when the locked virtual MFA device was automatically unlocked. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.', example='2021-06-23T06:20:49Z'),
      id?: long(name='Id', description='>  This parameter is not publicly available.', example='36'),
      serialNumber?: string(name='SerialNumber', description='The serial number of the virtual MFA device. The serial number is unique for each device.', example='dc856334-446b-4035-bfbc-18af261e****'),
      status?: string(name='Status', description='The status of the virtual MFA device.

Valid values:

*   LOCKED

    <!-- -->

    <!-- -->

    <!-- -->

*   UNBOUND

    <!-- -->

    <!-- -->

    <!-- -->

*   NORMAL

    <!-- -->

    <!-- -->

    <!-- -->', example='NORMAL'),
    }
  ](name='MfaDevices', description='The information about the virtual MFA devices.'),
  nextToken?: string(name='NextToken', description='The pagination token that is used in the next request to retrieve a new page of results.', example='AAAAAV3MpHK1AP0pfERHZN5pu6na6YlN9asMM31MsMcdQNpp'),
  requestId?: string(name='RequestId', description='The request ID.', example='33DBB8EC-6E68-4726-91C4-E09C59D9A7D8'),
}

model DescribeMfaDevicesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeMfaDevicesResponseBody(name='body'),
}

/**
 * @summary Queries the information about virtual multi-factor authentication (MFA) devices that are bound to convenience users.
 *
 * @param request DescribeMfaDevicesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeMfaDevicesResponse
 */
async function describeMfaDevicesWithOptions(request: DescribeMfaDevicesRequest, runtime: $RuntimeOptions): DescribeMfaDevicesResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.adDomain)) {
    query['AdDomain'] = request.adDomain;
  }
  if (!$isNull(request.endUserIds)) {
    query['EndUserIds'] = request.endUserIds;
  }
  if (!$isNull(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!$isNull(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!$isNull(request.serialNumbers)) {
    query['SerialNumbers'] = request.serialNumbers;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeMfaDevices',
    version = '2021-03-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the information about virtual multi-factor authentication (MFA) devices that are bound to convenience users.
 *
 * @param request DescribeMfaDevicesRequest
 * @return DescribeMfaDevicesResponse
 */
async function describeMfaDevices(request: DescribeMfaDevicesRequest): DescribeMfaDevicesResponse {
  var runtime = new $RuntimeOptions{};
  return describeMfaDevicesWithOptions(request, runtime);
}

model DescribeOrgByLayerRequest {
  orgName?: string(name='OrgName'),
  parentOrgId?: string(name='ParentOrgId', example='org-11fs****'),
}

model DescribeOrgByLayerResponseBody = {
  orgs?: [ 
    {
      orgId?: string(name='OrgId', example='org-1mox****'),
      orgName?: string(name='OrgName'),
      parentOrgId?: string(name='ParentOrgId', example='org-ezqr****'),
    }
  ](name='Orgs'),
  requestId?: string(name='RequestId', example='1CBAFFAB-B697-4049-A9B1-67E1FC5F****'),
}

model DescribeOrgByLayerResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeOrgByLayerResponseBody(name='body'),
}

/**
 * @summary 查找下级组织
 *
 * @param request DescribeOrgByLayerRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeOrgByLayerResponse
 */
async function describeOrgByLayerWithOptions(request: DescribeOrgByLayerRequest, runtime: $RuntimeOptions): DescribeOrgByLayerResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.orgName)) {
    body['OrgName'] = request.orgName;
  }
  if (!$isNull(request.parentOrgId)) {
    body['ParentOrgId'] = request.parentOrgId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeOrgByLayer',
    version = '2021-03-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查找下级组织
 *
 * @param request DescribeOrgByLayerRequest
 * @return DescribeOrgByLayerResponse
 */
async function describeOrgByLayer(request: DescribeOrgByLayerRequest): DescribeOrgByLayerResponse {
  var runtime = new $RuntimeOptions{};
  return describeOrgByLayerWithOptions(request, runtime);
}

model DescribeOrgsRequest {
  maxResults?: long(name='MaxResults', description='The maximum number of entries to return. Valid values: 1 to 100.\\\\
Default value: 100.', example='20'),
  nextToken?: string(name='NextToken', description='The token that determines the start point of the query. The return value is the value of the NextToken response parameter that was returned last time the DescribeOrgs operation was called.', example='AAAAAV3MpHK****'),
  orgName?: string(name='OrgName', description='The name of the organization.', example='org****'),
  parentOrgId?: string(name='ParentOrgId', description='The parent organization ID.', example='org-****'),
}

model DescribeOrgsResponseBody = {
  nextToken?: string(name='NextToken', description='The token that determines the start point of the query. The return value is the value of the NextToken response parameter that was returned last time the DescribeOrgs operation was called.', example='AAAAAV3MpHK****'),
  orgs?: [ 
    {
      orgId?: string(name='OrgId', description='The organization ID.', example='org-****'),
      orgName?: string(name='OrgName', description='The name of the organizational unit.', example='org****'),
      parentOrgId?: string(name='ParentOrgId', description='The parent organization ID.', example='org-****'),
    }
  ](name='Orgs', description='The organizations.'),
  requestId?: string(name='RequestId', description='The request ID.', example='0B4BB****'),
}

model DescribeOrgsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeOrgsResponseBody(name='body'),
}

/**
 * @summary Queries organizations.
 *
 * @description An organization is in a tree structure. The root organization ID is in the following format: org-aliyun-wy-org-id.
 *
 * @param request DescribeOrgsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeOrgsResponse
 */
async function describeOrgsWithOptions(request: DescribeOrgsRequest, runtime: $RuntimeOptions): DescribeOrgsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!$isNull(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!$isNull(request.orgName)) {
    query['OrgName'] = request.orgName;
  }
  if (!$isNull(request.parentOrgId)) {
    query['ParentOrgId'] = request.parentOrgId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeOrgs',
    version = '2021-03-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries organizations.
 *
 * @description An organization is in a tree structure. The root organization ID is in the following format: org-aliyun-wy-org-id.
 *
 * @param request DescribeOrgsRequest
 * @return DescribeOrgsResponse
 */
async function describeOrgs(request: DescribeOrgsRequest): DescribeOrgsResponse {
  var runtime = new $RuntimeOptions{};
  return describeOrgsWithOptions(request, runtime);
}

model DescribeResourceGroupsRequest {
  needContainResourceGroupWithOfficeSite?: long(name='NeedContainResourceGroupWithOfficeSite', example='0'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='20'),
  platform?: string(name='Platform', example='AliyunConsole'),
  resourceGroupIds?: [ string ](name='ResourceGroupIds'),
  resourceGroupName?: string(name='ResourceGroupName'),
}

model DescribeResourceGroupsResponseBody = {
  requestId?: string(name='RequestId', example='68BA1DF7-8814-5AED-B844-F8F7F7****'),
  resourceGroup?: [ 
    {
      authCount?: string(name='AuthCount', example='3'),
      createTime?: string(name='CreateTime', example='2022-11-29T17:25:40.000000000Z'),
      policies?: [ 
        {
          id?: string(name='Id', example='pl-a8jnatl8kjasb***'),
          isDefault?: boolean(name='IsDefault', example='False'),
          name?: string(name='Name'),
        }
      ](name='Policies'),
      resourceCount?: string(name='ResourceCount', example='119'),
      resourceGroupId?: string(name='ResourceGroupId', example='rg-cyo0il2pzge1***'),
      resourceGroupName?: string(name='ResourceGroupName'),
      timers?: [ 
        {
          id?: string(name='Id', example='t-asdzx0mbjhg***'),
          name?: string(name='Name'),
        }
      ](name='Timers'),
    }
  ](name='ResourceGroup'),
  totalCount?: string(name='TotalCount', example='7'),
}

model DescribeResourceGroupsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeResourceGroupsResponseBody(name='body'),
}

/**
 * @summary 查看资源组
 *
 * @param request DescribeResourceGroupsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeResourceGroupsResponse
 */
async function describeResourceGroupsWithOptions(request: DescribeResourceGroupsRequest, runtime: $RuntimeOptions): DescribeResourceGroupsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.needContainResourceGroupWithOfficeSite)) {
    query['NeedContainResourceGroupWithOfficeSite'] = request.needContainResourceGroupWithOfficeSite;
  }
  if (!$isNull(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.platform)) {
    query['Platform'] = request.platform;
  }
  if (!$isNull(request.resourceGroupIds)) {
    query['ResourceGroupIds'] = request.resourceGroupIds;
  }
  if (!$isNull(request.resourceGroupName)) {
    query['ResourceGroupName'] = request.resourceGroupName;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeResourceGroups',
    version = '2021-03-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查看资源组
 *
 * @param request DescribeResourceGroupsRequest
 * @return DescribeResourceGroupsResponse
 */
async function describeResourceGroups(request: DescribeResourceGroupsRequest): DescribeResourceGroupsResponse {
  var runtime = new $RuntimeOptions{};
  return describeResourceGroupsWithOptions(request, runtime);
}

model DescribeUsersRequest {
  bizType?: string(name='BizType'),
  endUserIds?: [ string ](name='EndUserIds', description='The usernames that must be exactly matched.'),
  excludeEndUserIds?: [ string ](name='ExcludeEndUserIds', description='The usernames that must be exactly excluded.'),
  filter?: string(name='Filter', description='The string that is used for fuzzy search. You perform fuzzy search by username (EndUserId) and email address (Email). Wildcard characters (\\\\*) are supported. For example, if you set this parameter to `a*m`, usernames or email addresses that start with `a` and end with `m` are returned.', example='a*m'),
  filterWithAssignedResource?: map[string]string(name='FilterWithAssignedResource'),
  filterWithAssignedResources?: map[string]boolean(name='FilterWithAssignedResources'),
  groupId?: string(name='GroupId', description='The ID of the organization in which you want to query convenience users.', example='ug-12341234****'),
  isQueryAllSubOrgs?: boolean(name='IsQueryAllSubOrgs'),
  maxResults?: long(name='MaxResults', description='The maximum number of entries per page.

*   Valid values: 1 to 500.
*   Default value: 500.', example='10'),
  nextToken?: string(name='NextToken', description='The pagination token that is used in the next request to retrieve a new page of results. You do not need to specify this parameter for the first request.\\\\
If not all results are returned in a query, a value is returned for the NextToken parameter. In this case, you can use the return value of NextToken to perform the next query.', example='caeba0bbb2be03f84eb48b699f0a****'),
  orgId?: string(name='OrgId', description='The ID of the organization in which you want to query users.', example='org-4mdgc1cocc59z****'),
  showExtras?: map[string]any(name='ShowExtras'),
  solutionId?: string(name='SolutionId'),
}

model DescribeUsersShrinkRequest {
  bizType?: string(name='BizType'),
  endUserIds?: [ string ](name='EndUserIds', description='The usernames that must be exactly matched.'),
  excludeEndUserIds?: [ string ](name='ExcludeEndUserIds', description='The usernames that must be exactly excluded.'),
  filter?: string(name='Filter', description='The string that is used for fuzzy search. You perform fuzzy search by username (EndUserId) and email address (Email). Wildcard characters (\\\\*) are supported. For example, if you set this parameter to `a*m`, usernames or email addresses that start with `a` and end with `m` are returned.', example='a*m'),
  filterWithAssignedResourceShrink?: string(name='FilterWithAssignedResource'),
  filterWithAssignedResourcesShrink?: string(name='FilterWithAssignedResources'),
  groupId?: string(name='GroupId', description='The ID of the organization in which you want to query convenience users.', example='ug-12341234****'),
  isQueryAllSubOrgs?: boolean(name='IsQueryAllSubOrgs'),
  maxResults?: long(name='MaxResults', description='The maximum number of entries per page.

*   Valid values: 1 to 500.
*   Default value: 500.', example='10'),
  nextToken?: string(name='NextToken', description='The pagination token that is used in the next request to retrieve a new page of results. You do not need to specify this parameter for the first request.\\\\
If not all results are returned in a query, a value is returned for the NextToken parameter. In this case, you can use the return value of NextToken to perform the next query.', example='caeba0bbb2be03f84eb48b699f0a****'),
  orgId?: string(name='OrgId', description='The ID of the organization in which you want to query users.', example='org-4mdgc1cocc59z****'),
  showExtrasShrink?: string(name='ShowExtras'),
  solutionId?: string(name='SolutionId'),
}

model DescribeUsersResponseBody = {
  nextToken?: string(name='NextToken', description='The token that determines the start point of the next query. If this parameter is left empty, all results are returned.', example='caeba0bbb2be03f84eb48b699f0a4883'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='1CBAFFAB-B697-4049-A9B1-67E1FC5F****'),
  users?: [ 
    {
      address?: string(name='Address', description='The work address of the convenience user.', example='Hangzhou \\\\*\\\\*\\\\*'),
      avatar?: string(name='Avatar', description='The profile picture of the convenience user.', example='https://cdn.*****'),
      email?: string(name='Email', description='The email address of the convenience user.', example='username@example.com'),
      endUserId?: string(name='EndUserId', description='The username of the convenience user.', example='alice'),
      externalName?: string(name='ExternalName'),
      extras?: {
        assignedResourceCount?: map[string]any(name='AssignedResourceCount'),
      }(name='Extras'),
      groups?: [ 
        {
          groupId?: string(name='GroupId', description='The ID of the user group.', example='ug-12341234****'),
          groupName?: string(name='GroupName', description='The name of the user group.', example='User Group 1'),
        }
      ](name='Groups', description='The user groups to which the convenience user belongs.'),
      id?: long(name='Id', description='The ID of the convenience user.', example='4205**'),
      isTenantManager?: boolean(name='IsTenantManager', description='Indicates whether the convenience user is an administrator. If the convenience user is of the administrator-activated type, you must specify a user administrator. Notifications such as password reset on a client are sent to the email address or mobile number of the user administrator. For more information, see [Create a convenience user](https://help.aliyun.com/document_detail/214472.html).', example='true'),
      jobNumber?: string(name='JobNumber', description='The employee number of the convenience user.', example='A10000**'),
      nickName?: string(name='NickName', description='The nickname of the convenience user.', example='Lee'),
      orgId?: string(name='OrgId', description='The ID of the organization to which the convenience user belongs.

>  This parameter will be deprecated in the future.', example='org-4mdgc1cocc59z****'),
      orgs?: [ 
        {
          orgId?: string(name='OrgId', description='The organization ID.', example='org-4mdgc1cocc59z****'),
          orgName?: string(name='OrgName', description='The organization name.', example='Organization 1'),
        }
      ](name='Orgs', description='The organizations to which the convenience user belongs.'),
      ownerType?: string(name='OwnerType', description='The type of the convenience account.

*   Administrator-activated type: The administrator specifies the username and password of the convenience account. User notifications such as password reset notifications are sent to the email address or mobile number of the administrator.
*   User-activated type: The administrator specifies the username and the email address or mobile number of a convenience user. Notifications such as activation notifications that contain the default password are sent to the email address or mobile number of the convenience user.

Valid values:

*   CreateFromManager

    <!-- -->

    :

    <!-- -->

    administrator-activated

    <!-- -->

*   Normal

    <!-- -->

    :

    <!-- -->

    user-activated

    <!-- -->', example='Normal'),
      phone?: string(name='Phone', description='The mobile number of the convenience user. If you leave this parameter empty, the value of this parameter is not returned.', example='1381111****'),
      properties?: [ 
        {
          key?: string(name='Key'),
          value?: string(name='Value'),
        }
      ](name='Properties'),
      realNickName?: string(name='RealNickName'),
      remark?: string(name='Remark', description='The remarks on the convenience user.', example='TestUser'),
      status?: long(name='Status', description='The status of the convenience user.

Valid values:

*   0: The convenience user is normal.

    <!-- -->

    <!-- -->

    <!-- -->

*   9: The convenience user is locked.

    <!-- -->

    <!-- -->

    <!-- -->', example='0'),
      wyId?: string(name='WyId', description='The globally unique ID of the convenience user.', example='41fd1254d8f7****'),
    }
  ](name='Users', description='The convenience accounts.'),
}

model DescribeUsersResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeUsersResponseBody(name='body'),
}

/**
 * @summary Queries the information about convenience users. The information of a convenience user includes a username, an email address, and a description.
 *
 * @param tmpReq DescribeUsersRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeUsersResponse
 */
async function describeUsersWithOptions(tmpReq: DescribeUsersRequest, runtime: $RuntimeOptions): DescribeUsersResponse {
  tmpReq.validate();
  var request = new DescribeUsersShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.filterWithAssignedResource)) {
    request.filterWithAssignedResourceShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.filterWithAssignedResource, 'FilterWithAssignedResource', 'json');
  }
  if (!$isNull(tmpReq.filterWithAssignedResources)) {
    request.filterWithAssignedResourcesShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.filterWithAssignedResources, 'FilterWithAssignedResources', 'json');
  }
  if (!$isNull(tmpReq.showExtras)) {
    request.showExtrasShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.showExtras, 'ShowExtras', 'json');
  }
  var query = {};
  if (!$isNull(request.filter)) {
    query['Filter'] = request.filter;
  }
  if (!$isNull(request.filterWithAssignedResourceShrink)) {
    query['FilterWithAssignedResource'] = request.filterWithAssignedResourceShrink;
  }
  if (!$isNull(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!$isNull(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  var body : map[string]any = {};
  if (!$isNull(request.bizType)) {
    body['BizType'] = request.bizType;
  }
  if (!$isNull(request.endUserIds)) {
    body['EndUserIds'] = request.endUserIds;
  }
  if (!$isNull(request.excludeEndUserIds)) {
    body['ExcludeEndUserIds'] = request.excludeEndUserIds;
  }
  if (!$isNull(request.filterWithAssignedResourcesShrink)) {
    body['FilterWithAssignedResources'] = request.filterWithAssignedResourcesShrink;
  }
  if (!$isNull(request.groupId)) {
    body['GroupId'] = request.groupId;
  }
  if (!$isNull(request.isQueryAllSubOrgs)) {
    body['IsQueryAllSubOrgs'] = request.isQueryAllSubOrgs;
  }
  if (!$isNull(request.orgId)) {
    body['OrgId'] = request.orgId;
  }
  if (!$isNull(request.showExtrasShrink)) {
    body['ShowExtras'] = request.showExtrasShrink;
  }
  if (!$isNull(request.solutionId)) {
    body['SolutionId'] = request.solutionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeUsers',
    version = '2021-03-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the information about convenience users. The information of a convenience user includes a username, an email address, and a description.
 *
 * @param request DescribeUsersRequest
 * @return DescribeUsersResponse
 */
async function describeUsers(request: DescribeUsersRequest): DescribeUsersResponse {
  var runtime = new $RuntimeOptions{};
  return describeUsersWithOptions(request, runtime);
}

model FilterUsersRequest {
  excludeEndUserIds?: [ string ](name='ExcludeEndUserIds', description='The list of usernames to be precisely excluded.'),
  filter?: string(name='Filter', description='The string that is used for fuzzy search. You can use usernames and email addresses to perform fuzzy search. Wildcard characters (\\\\*) are supported for this parameter. For example, if you set this parameter to a\\\\*m, the usernames or an email addresses that start with a or end with m are returned.', example='test'),
  includeDesktopCount?: boolean(name='IncludeDesktopCount', description='Specifies whether to return the number of cloud desktops that are assigned to the convenience user.

Valid values:

*   true

    <!-- -->

    <!-- -->

    <!-- -->

*   false

    <!-- -->

    <!-- -->

    <!-- -->', example='true'),
  includeDesktopGroupCount?: boolean(name='IncludeDesktopGroupCount', description='Specifies whether to return the number of cloud desktop pools that are assigned to the convenience user.

Valid values:

*   true

    <!-- -->

    <!-- -->

    <!-- -->

*   false

    <!-- -->

    <!-- -->

    <!-- -->', example='false'),
  includeOrgInfo?: boolean(name='IncludeOrgInfo'),
  includeSupportIdps?: boolean(name='IncludeSupportIdps'),
  isQueryAllSubOrgs?: boolean(name='IsQueryAllSubOrgs'),
  maxResults?: long(name='MaxResults', description='The number of entries per page. If you set this parameter to a value greater than 100, the system resets the value to 100.', example='10'),
  nextToken?: string(name='NextToken', description='The pagination token that is used in the next request to retrieve a new page of results. You do not need to specify this parameter for the first request. If not all results are returned in a query, a value is returned for the NextToken parameter. In this case, you can use the returned NextToken value to start the next query.', example='caeba0bbb2be03f84eb48b699f0a4883'),
  orderParam?: {
    orderField?: string(name='OrderField', description='The field that you want to sort by.

Valid values:

*   EndUserId: the username.
*   id: the ID of the primary key.
*   gmt_created: the creation time.', example='id'),
    orderType?: string(name='OrderType', description='The direction of the sort.

Valid values:

*   ASC: the ascending order.
*   DESC (default): the descending order.', example='ASC'),
  }(name='OrderParam', description='The parameter that might affect the sorting logic.'),
  orgId?: string(name='OrgId', description='The ID of the organization.', example='org-aliyun-wy-org-id'),
  ownerType?: string(name='OwnerType', description='The activation type of the convenience account.

Valid values:

*   CreateFromManager: administrator-activated.
*   Normal: user-activated.', example='Normal'),
  propertyFilterParam?: [ 
    {
      propertyId?: long(name='PropertyId', description='The ID of the property.', example='123'),
      propertyValueIds?: string(name='PropertyValueIds', description='The IDs of the property values.', example='test'),
    }
  ](name='PropertyFilterParam', description='The list of properties for fuzzy search.'),
  propertyKeyValueFilterParam?: [ 
    {
      propertyKey?: string(name='PropertyKey', description='The property name.', example='job'),
      propertyValues?: string(name='PropertyValues', description='The property values.', example='dev'),
    }
  ](name='PropertyKeyValueFilterParam', description='The list of property names and property values.'),
  status?: int32(name='Status'),
}

model FilterUsersShrinkRequest {
  excludeEndUserIds?: [ string ](name='ExcludeEndUserIds', description='The list of usernames to be precisely excluded.'),
  filter?: string(name='Filter', description='The string that is used for fuzzy search. You can use usernames and email addresses to perform fuzzy search. Wildcard characters (\\\\*) are supported for this parameter. For example, if you set this parameter to a\\\\*m, the usernames or an email addresses that start with a or end with m are returned.', example='test'),
  includeDesktopCount?: boolean(name='IncludeDesktopCount', description='Specifies whether to return the number of cloud desktops that are assigned to the convenience user.

Valid values:

*   true

    <!-- -->

    <!-- -->

    <!-- -->

*   false

    <!-- -->

    <!-- -->

    <!-- -->', example='true'),
  includeDesktopGroupCount?: boolean(name='IncludeDesktopGroupCount', description='Specifies whether to return the number of cloud desktop pools that are assigned to the convenience user.

Valid values:

*   true

    <!-- -->

    <!-- -->

    <!-- -->

*   false

    <!-- -->

    <!-- -->

    <!-- -->', example='false'),
  includeOrgInfo?: boolean(name='IncludeOrgInfo'),
  includeSupportIdps?: boolean(name='IncludeSupportIdps'),
  isQueryAllSubOrgs?: boolean(name='IsQueryAllSubOrgs'),
  maxResults?: long(name='MaxResults', description='The number of entries per page. If you set this parameter to a value greater than 100, the system resets the value to 100.', example='10'),
  nextToken?: string(name='NextToken', description='The pagination token that is used in the next request to retrieve a new page of results. You do not need to specify this parameter for the first request. If not all results are returned in a query, a value is returned for the NextToken parameter. In this case, you can use the returned NextToken value to start the next query.', example='caeba0bbb2be03f84eb48b699f0a4883'),
  orderParamShrink?: string(name='OrderParam', description='The parameter that might affect the sorting logic.'),
  orgId?: string(name='OrgId', description='The ID of the organization.', example='org-aliyun-wy-org-id'),
  ownerType?: string(name='OwnerType', description='The activation type of the convenience account.

Valid values:

*   CreateFromManager: administrator-activated.
*   Normal: user-activated.', example='Normal'),
  propertyFilterParam?: [ 
    {
      propertyId?: long(name='PropertyId', description='The ID of the property.', example='123'),
      propertyValueIds?: string(name='PropertyValueIds', description='The IDs of the property values.', example='test'),
    }
  ](name='PropertyFilterParam', description='The list of properties for fuzzy search.'),
  propertyKeyValueFilterParam?: [ 
    {
      propertyKey?: string(name='PropertyKey', description='The property name.', example='job'),
      propertyValues?: string(name='PropertyValues', description='The property values.', example='dev'),
    }
  ](name='PropertyKeyValueFilterParam', description='The list of property names and property values.'),
  status?: int32(name='Status'),
}

model FilterUsersResponseBody = {
  nextToken?: string(name='NextToken', description='The pagination token that is used in the next request to retrieve a new page of results. If not all results are returned in a query, a value is returned for the NextToken parameter. In this case, you can use the returned NextToken value to start the next query.', example='caeba0bbb2be03f84eb48b699f0a4883'),
  requestId?: string(name='RequestId', description='The request ID.', example='DBD276B5-00FF-5E04-8EF7-5CBA09BF112A'),
  users?: [ 
    {
      autoLockTime?: string(name='AutoLockTime', description='The date when a convenience account is automatically locked.', example='2023-03-03'),
      desktopCount?: long(name='DesktopCount', description='The number of cloud desktops that are assigned to the convenience user.', example='1'),
      desktopGroupCount?: long(name='DesktopGroupCount', description='The number of cloud desktop pools that are assigned to the convenience user. This value is returned if you set `IncludeDesktopGroupCount` to `true`.', example='2'),
      email?: string(name='Email', description='The email address of the convenience user.', example='testName@example.com'),
      enableAdminAccess?: boolean(name='EnableAdminAccess', description='Indicates whether the convenience user is a local administrator.

Valid values:

*   true

    <!-- -->

    <!-- -->

    <!-- -->

*   false

    <!-- -->

    <!-- -->

    <!-- -->', example='true'),
      endUserId?: string(name='EndUserId', description='The username of the convenience user.', example='testName'),
      externalInfo?: {
        externalName?: string(name='ExternalName', description='The account that is associated with the convenience user.', example='test'),
        jobNumber?: string(name='JobNumber', description='The account, student ID, or employee ID that is associated with the convenience user.', example='030801'),
      }(name='ExternalInfo', description='The additional information about the convenience user.'),
      id?: long(name='Id', description='The ID of the convenience user.', example='12345'),
      isTenantManager?: boolean(name='IsTenantManager', description='Indicates whether the convenience user is a tenant administrator.

Valid values:

*   true

    <!-- -->

    <!-- -->

    <!-- -->

*   false

    <!-- -->

    <!-- -->

    <!-- -->', example='true'),
      orgList?: [ 
        {
          orgId?: string(name='OrgId'),
          orgName?: string(name='OrgName'),
        }
      ](name='OrgList'),
      ownerType?: string(name='OwnerType', description='The type of the account ownership.

Valid values:

*   CreateFromManager: administrator-activated
*   Normal: user-activated', example='Normal'),
      passwordExpireDays?: int32(name='PasswordExpireDays', description='By default, user account passwords do not expire. However, you can set a validity period between 30 and 365 days. Once the period expires, end users must change their password before they can log on to terminals.

>  The feature is in invitational preview. If you want to use this feature, submit a ticket.', example='30'),
      passwordExpireRestDays?: int32(name='PasswordExpireRestDays', description='The number of days remaining until the account password expires.', example='10'),
      phone?: string(name='Phone', description='The mobile number of the convenience user.', example='1381111****'),
      realNickName?: string(name='RealNickName', description='The nickname of the convenience user.', example='Oliver'),
      remark?: string(name='Remark', description='The remarks on the convenience user.', example='1'),
      status?: long(name='Status', description='The remarks on the convenience account.

Valid values:

*   0: The convenience account is normal.
*   9: The convenience account is locked.', example='0'),
      supportLoginIdps?: [ 
        {
          idpId?: string(name='IdpId'),
          idpName?: string(name='IdpName'),
        }
      ](name='SupportLoginIdps'),
      userSetPropertiesModels?: [ 
        {
          propertyId?: long(name='PropertyId', description='The property ID.', example='12'),
          propertyKey?: string(name='PropertyKey', description='The property name.', example='department'),
          propertyType?: int32(name='PropertyType', description='The property type.', example='2'),
          propertyValues?: [ 
            {
              propertyValue?: string(name='PropertyValue', description='The property value.', example='A'),
              propertyValueId?: long(name='PropertyValueId', description='The ID of the property value.', example='42'),
            }
          ](name='PropertyValues', description='The property values.'),
          userId?: long(name='UserId', description='The ID of the convenience user that is bound to the property.', example='12345'),
          userName?: string(name='UserName', description='The username of the convenience user that is bound to the property.', example='testName'),
        }
      ](name='UserSetPropertiesModels', description='The information about the properties.'),
    }
  ](name='Users', description='The convenience accounts.'),
}

model FilterUsersResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: FilterUsersResponseBody(name='body'),
}

/**
 * @summary Filters convenience accounts by property.
 *
 * @param tmpReq FilterUsersRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return FilterUsersResponse
 */
async function filterUsersWithOptions(tmpReq: FilterUsersRequest, runtime: $RuntimeOptions): FilterUsersResponse {
  tmpReq.validate();
  var request = new FilterUsersShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.orderParam)) {
    request.orderParamShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.orderParam, 'OrderParam', 'json');
  }
  var query = {};
  if (!$isNull(request.excludeEndUserIds)) {
    query['ExcludeEndUserIds'] = request.excludeEndUserIds;
  }
  if (!$isNull(request.filter)) {
    query['Filter'] = request.filter;
  }
  if (!$isNull(request.includeDesktopCount)) {
    query['IncludeDesktopCount'] = request.includeDesktopCount;
  }
  if (!$isNull(request.includeDesktopGroupCount)) {
    query['IncludeDesktopGroupCount'] = request.includeDesktopGroupCount;
  }
  if (!$isNull(request.includeOrgInfo)) {
    query['IncludeOrgInfo'] = request.includeOrgInfo;
  }
  if (!$isNull(request.includeSupportIdps)) {
    query['IncludeSupportIdps'] = request.includeSupportIdps;
  }
  if (!$isNull(request.isQueryAllSubOrgs)) {
    query['IsQueryAllSubOrgs'] = request.isQueryAllSubOrgs;
  }
  if (!$isNull(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!$isNull(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!$isNull(request.orderParamShrink)) {
    query['OrderParam'] = request.orderParamShrink;
  }
  if (!$isNull(request.orgId)) {
    query['OrgId'] = request.orgId;
  }
  if (!$isNull(request.ownerType)) {
    query['OwnerType'] = request.ownerType;
  }
  if (!$isNull(request.propertyFilterParam)) {
    query['PropertyFilterParam'] = request.propertyFilterParam;
  }
  if (!$isNull(request.propertyKeyValueFilterParam)) {
    query['PropertyKeyValueFilterParam'] = request.propertyKeyValueFilterParam;
  }
  if (!$isNull(request.status)) {
    query['Status'] = request.status;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'FilterUsers',
    version = '2021-03-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Filters convenience accounts by property.
 *
 * @param request FilterUsersRequest
 * @return FilterUsersResponse
 */
async function filterUsers(request: FilterUsersRequest): FilterUsersResponse {
  var runtime = new $RuntimeOptions{};
  return filterUsersWithOptions(request, runtime);
}

model GetManagerInfoByAuthCodeRequest {
  authCode?: string(name='AuthCode', description='The authorization code.

This parameter is required.', example='e49cd070452f0044813a467d4743****'),
}

model GetManagerInfoByAuthCodeResponseBody = {
  orgId?: string(name='OrgId', description='The organization ID.', example='12345678901234****'),
  phone?: string(name='Phone', description='The mobile number.', example='1301234****'),
  requestId?: string(name='RequestId', description='The request ID.', example='1CBAFFAB-B697-4049-A9B1-67E1FC5F****'),
  teamName?: string(name='TeamName', description='The team name.', example='devteam'),
  userName?: string(name='UserName', description='The tenant name.', example='zhangsan'),
  waId?: long(name='WaId', description='The ID of the Elastic Desktop Service account.', example='12345678901234****'),
}

model GetManagerInfoByAuthCodeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetManagerInfoByAuthCodeResponseBody(name='body'),
}

/**
 * @summary Obtains the information about the current logon administrator based on the authorization code.
 *
 * @param request GetManagerInfoByAuthCodeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetManagerInfoByAuthCodeResponse
 */
async function getManagerInfoByAuthCodeWithOptions(request: GetManagerInfoByAuthCodeRequest, runtime: $RuntimeOptions): GetManagerInfoByAuthCodeResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.authCode)) {
    query['AuthCode'] = request.authCode;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetManagerInfoByAuthCode',
    version = '2021-03-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Obtains the information about the current logon administrator based on the authorization code.
 *
 * @param request GetManagerInfoByAuthCodeRequest
 * @return GetManagerInfoByAuthCodeResponse
 */
async function getManagerInfoByAuthCode(request: GetManagerInfoByAuthCodeRequest): GetManagerInfoByAuthCodeResponse {
  var runtime = new $RuntimeOptions{};
  return getManagerInfoByAuthCodeWithOptions(request, runtime);
}

model InitTenantAliasResponseBody = {
  aliasInfo?: {
    aliasEditDisabledReason?: string(name='AliasEditDisabledReason', example='FrequencyExceedsLimit'),
    aliasEditable?: boolean(name='AliasEditable', example='False'),
    aliasSourceType?: string(name='AliasSourceType', example='Customized'),
    nextModifyTime?: string(name='NextModifyTime', example='2025-04-17 20:31:48'),
  }(name='AliasInfo'),
  data?: string(name='Data', example='WY23***'),
  requestId?: string(name='RequestId', example='1CBAFFAB-B697-4049-A9B1-67E1FC5F****'),
}

model InitTenantAliasResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: InitTenantAliasResponseBody(name='body'),
}

/**
 * @summary 初始化TenantAlias
 *
 * @param request InitTenantAliasRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return InitTenantAliasResponse
 */
async function initTenantAliasWithOptions(runtime: $RuntimeOptions): InitTenantAliasResponse {
  var req = new OpenApiUtil.OpenApiRequest{};
  var params = new OpenApiUtil.Params{
    action = 'InitTenantAlias',
    version = '2021-03-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 初始化TenantAlias
 *
 * @return InitTenantAliasResponse
 */
async function initTenantAlias(): InitTenantAliasResponse {
  var runtime = new $RuntimeOptions{};
  return initTenantAliasWithOptions(runtime);
}

model ListPropertyResponseBody = {
  nextToken?: string(name='NextToken', description='The token that is used for the next query. If this parameter is empty, all results have been returned.', example='caeba0bbb2be03f84eb48b699f0a4883'),
  properties?: [ 
    {
      propertyId?: long(name='PropertyId', description='The ID of the property.', example='30'),
      propertyKey?: string(name='PropertyKey', description='The name of the property.', example='department'),
      propertyValues?: [ 
        {
          propertyValue?: string(name='PropertyValue', description='The value of the property.', example='A'),
          propertyValueId?: long(name='PropertyValueId', description='The ID of the property value.', example='42'),
        }
      ](name='PropertyValues', description='Details about the property values.'),
    }
  ](name='Properties', description='The information about the properties.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='1CBAFFAB-B697-4049-A9B1-67E1FC5F****'),
}

model ListPropertyResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListPropertyResponseBody(name='body'),
}

/**
 * @summary Queries all user properties within an Alibaba Cloud account.
 *
 * @param request ListPropertyRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListPropertyResponse
 */
async function listPropertyWithOptions(runtime: $RuntimeOptions): ListPropertyResponse {
  var req = new OpenApiUtil.OpenApiRequest{};
  var params = new OpenApiUtil.Params{
    action = 'ListProperty',
    version = '2021-03-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries all user properties within an Alibaba Cloud account.
 *
 * @return ListPropertyResponse
 */
async function listProperty(): ListPropertyResponse {
  var runtime = new $RuntimeOptions{};
  return listPropertyWithOptions(runtime);
}

model ListPropertyValueRequest {
  propertyId?: long(name='PropertyId', description='The ID of the property. You can call the [ListProperty](https://help.aliyun.com/document_detail/410890.html) operation to query the property ID.

This parameter is required.', example='390'),
}

model ListPropertyValueResponseBody = {
  propertyValueInfos?: [ 
    {
      propertyValue?: string(name='PropertyValue', description='The value of the property.', example='HR'),
      propertyValueId?: long(name='PropertyValueId', description='The ID of the property value.', example='978'),
    }
  ](name='PropertyValueInfos', description='Details about property values.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='C52013A5-3422-5D1F-B22C-A57110972AD9'),
}

model ListPropertyValueResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListPropertyValueResponseBody(name='body'),
}

/**
 * @summary Queries property values of a user property.
 *
 * @param request ListPropertyValueRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListPropertyValueResponse
 */
async function listPropertyValueWithOptions(request: ListPropertyValueRequest, runtime: $RuntimeOptions): ListPropertyValueResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.propertyId)) {
    query['PropertyId'] = request.propertyId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListPropertyValue',
    version = '2021-03-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries property values of a user property.
 *
 * @param request ListPropertyValueRequest
 * @return ListPropertyValueResponse
 */
async function listPropertyValue(request: ListPropertyValueRequest): ListPropertyValueResponse {
  var runtime = new $RuntimeOptions{};
  return listPropertyValueWithOptions(request, runtime);
}

model LockMfaDeviceRequest {
  adDomain?: string(name='AdDomain', description='The domain of the Active Directory (AD) workspace.', example='pg-jifenn.com'),
  serialNumber?: string(name='SerialNumber', description='The serial number of the virtual MFA device. The serial number is unique for each device.', example='dc856334-446b-4035-bfbc-18af261e****'),
}

model LockMfaDeviceResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='42FE70D8-4336-471B-8314-CCCFCE4159FD'),
}

model LockMfaDeviceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: LockMfaDeviceResponseBody(name='body'),
}

/**
 * @summary Locks a virtual multi-factor authentication (MFA) device that is bound to a convenience user.
 *
 * @description After a virtual MFA device is locked, the status of the virtual MFA device changes to LOCKED. The convenience user to which the MFA device is bound cannot log on to the cloud desktop that resides in the workspace with the MFA feature enabled because the identity of the convenience user cannot be verified based on the virtual MFA device. You can call the [UnlockMfaDevice](https://help.aliyun.com/document_detail/286534.html) operation to unlock the virtual MFA device.
 *
 * @param request LockMfaDeviceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return LockMfaDeviceResponse
 */
async function lockMfaDeviceWithOptions(request: LockMfaDeviceRequest, runtime: $RuntimeOptions): LockMfaDeviceResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.adDomain)) {
    query['AdDomain'] = request.adDomain;
  }
  if (!$isNull(request.serialNumber)) {
    query['SerialNumber'] = request.serialNumber;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'LockMfaDevice',
    version = '2021-03-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Locks a virtual multi-factor authentication (MFA) device that is bound to a convenience user.
 *
 * @description After a virtual MFA device is locked, the status of the virtual MFA device changes to LOCKED. The convenience user to which the MFA device is bound cannot log on to the cloud desktop that resides in the workspace with the MFA feature enabled because the identity of the convenience user cannot be verified based on the virtual MFA device. You can call the [UnlockMfaDevice](https://help.aliyun.com/document_detail/286534.html) operation to unlock the virtual MFA device.
 *
 * @param request LockMfaDeviceRequest
 * @return LockMfaDeviceResponse
 */
async function lockMfaDevice(request: LockMfaDeviceRequest): LockMfaDeviceResponse {
  var runtime = new $RuntimeOptions{};
  return lockMfaDeviceWithOptions(request, runtime);
}

model LockUsersRequest {
  logoutSession?: boolean(name='LogoutSession'),
  users?: [ string ](name='Users', description='The usernames of the convenience users that you want to lock.

This parameter is required.', example='test1'),
}

model LockUsersResponseBody = {
  lockUsersResult?: {
    failedUsers?: [ 
      {
        endUserId?: string(name='EndUserId', description='The ID of the convenience user that failed to be locked.', example='test123'),
        errorCode?: string(name='ErrorCode', description='The error code.', example='InvalidUsername'),
        errorMessage?: string(name='ErrorMessage', description='The error message.', example='test123 is an invalid username.'),
      }
    ](name='FailedUsers', description='The convenience users that failed to be locked.'),
    lockedUsers?: [ string ](name='LockedUsers', description='The convenience users that were locked.'),
  }(name='LockUsersResult', description='The result of the locking the convenience user.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='1CBAFFAB-B697-4049-A9B1-67E1FC5F****'),
}

model LockUsersResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: LockUsersResponseBody(name='body'),
}

/**
 * @summary Locks one or more convenience users.
 *
 * @param request LockUsersRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return LockUsersResponse
 */
async function lockUsersWithOptions(request: LockUsersRequest, runtime: $RuntimeOptions): LockUsersResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.logoutSession)) {
    query['LogoutSession'] = request.logoutSession;
  }
  var body : map[string]any = {};
  if (!$isNull(request.users)) {
    body['Users'] = request.users;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'LockUsers',
    version = '2021-03-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Locks one or more convenience users.
 *
 * @param request LockUsersRequest
 * @return LockUsersResponse
 */
async function lockUsers(request: LockUsersRequest): LockUsersResponse {
  var runtime = new $RuntimeOptions{};
  return lockUsersWithOptions(request, runtime);
}

model ModifyOrgRequest {
  orgId?: string(name='OrgId', description='This parameter is required.', example='org-76joc57khvnhdh***'),
  orgName?: string(name='OrgName', description='This parameter is required.'),
}

model ModifyOrgResponseBody = {
  requestId?: string(name='RequestId', example='0296EDF8-3C8A-5128-8682-27B29C99****'),
}

model ModifyOrgResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyOrgResponseBody(name='body'),
}

/**
 * @summary 修改组织
 *
 * @param request ModifyOrgRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyOrgResponse
 */
async function modifyOrgWithOptions(request: ModifyOrgRequest, runtime: $RuntimeOptions): ModifyOrgResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.orgId)) {
    query['OrgId'] = request.orgId;
  }
  if (!$isNull(request.orgName)) {
    query['OrgName'] = request.orgName;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ModifyOrg',
    version = '2021-03-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 修改组织
 *
 * @param request ModifyOrgRequest
 * @return ModifyOrgResponse
 */
async function modifyOrg(request: ModifyOrgRequest): ModifyOrgResponse {
  var runtime = new $RuntimeOptions{};
  return modifyOrgWithOptions(request, runtime);
}

model ModifyUserRequest {
  email?: string(name='Email', description='The email address of the convenience user. For a user-activated convenience user, the email address or mobile number must be verified. You can choose to verify the email address or the mobile number. For an administrator-activated convenience user, the email address and mobile number can be left empty.', example='username@example.com'),
  endUserId?: string(name='EndUserId', description='The name of the user.

This parameter is required.', example='Alice'),
  phone?: string(name='Phone', description='The mobile number of the convenience user. For a user-activated convenience user, the email address or mobile number must be verified. You can choose to verify the email address or the mobile number. For an administrator-activated convenience user, the email address and mobile number can be left empty.

>  Accounts created on the International site (alibabacloud.com) do not support mobile number-based authentication.', example='1381111****'),
}

model ModifyUserResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='1CBAFFAB-B697-4049-A9B1-67E1FC5F****'),
}

model ModifyUserResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyUserResponseBody(name='body'),
}

/**
 * @summary Modifies user information.
 *
 * @param request ModifyUserRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyUserResponse
 */
async function modifyUserWithOptions(request: ModifyUserRequest, runtime: $RuntimeOptions): ModifyUserResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.email)) {
    query['Email'] = request.email;
  }
  if (!$isNull(request.endUserId)) {
    query['EndUserId'] = request.endUserId;
  }
  if (!$isNull(request.phone)) {
    query['Phone'] = request.phone;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ModifyUser',
    version = '2021-03-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Modifies user information.
 *
 * @param request ModifyUserRequest
 * @return ModifyUserResponse
 */
async function modifyUser(request: ModifyUserRequest): ModifyUserResponse {
  var runtime = new $RuntimeOptions{};
  return modifyUserWithOptions(request, runtime);
}

model MoveOrgRequest {
  newParentOrgId?: string(name='NewParentOrgId', description='This parameter is required.', example='org-5yy5icj981xe5****'),
  orgId?: string(name='OrgId', description='This parameter is required.', example='org-5yy5icj981xe5****'),
}

model MoveOrgResponseBody = {
  requestId?: string(name='RequestId', example='1CBAFFAB-B697-4049-A9B1-67E1FC5F****'),
}

model MoveOrgResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: MoveOrgResponseBody(name='body'),
}

/**
 * @summary 移动组织
 *
 * @param request MoveOrgRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return MoveOrgResponse
 */
async function moveOrgWithOptions(request: MoveOrgRequest, runtime: $RuntimeOptions): MoveOrgResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.newParentOrgId)) {
    body['NewParentOrgId'] = request.newParentOrgId;
  }
  if (!$isNull(request.orgId)) {
    body['OrgId'] = request.orgId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'MoveOrg',
    version = '2021-03-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 移动组织
 *
 * @param request MoveOrgRequest
 * @return MoveOrgResponse
 */
async function moveOrg(request: MoveOrgRequest): MoveOrgResponse {
  var runtime = new $RuntimeOptions{};
  return moveOrgWithOptions(request, runtime);
}

model QuerySyncStatusByAliUidResponseBody = {
  code?: string(name='Code', example='200'),
  data?: {
    aliUid?: long(name='AliUid', example='131239236086****'),
    corpId?: string(name='CorpId', example='cdrs948144195608****'),
    gmtCreated?: string(name='GmtCreated', example='2020-06-30 07:50:42'),
    gmtModified?: string(name='GmtModified', example='2022-03-02 14:27:39'),
    id?: long(name='Id', example='18500'),
    latestBeginTime?: string(name='LatestBeginTime', example='2022-03-02 14:31:39'),
    latestEndTime?: string(name='LatestEndTime', example='2022-03-02 16:13:12'),
    latestSuccessTime?: string(name='LatestSuccessTime', example='2022-03-02 18:24:01'),
    status?: string(name='Status', example='success'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='1CBAFFAB-B697-4049-A9B1-67E1FC5F****'),
  success?: boolean(name='Success', example='True'),
}

model QuerySyncStatusByAliUidResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QuerySyncStatusByAliUidResponseBody(name='body'),
}

/**
 * @summary 查询edu同步信息
 *
 * @param request QuerySyncStatusByAliUidRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return QuerySyncStatusByAliUidResponse
 */
async function querySyncStatusByAliUidWithOptions(runtime: $RuntimeOptions): QuerySyncStatusByAliUidResponse {
  var req = new OpenApiUtil.OpenApiRequest{};
  var params = new OpenApiUtil.Params{
    action = 'QuerySyncStatusByAliUid',
    version = '2021-03-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询edu同步信息
 *
 * @return QuerySyncStatusByAliUidResponse
 */
async function querySyncStatusByAliUid(): QuerySyncStatusByAliUidResponse {
  var runtime = new $RuntimeOptions{};
  return querySyncStatusByAliUidWithOptions(runtime);
}

model RemoveMfaDeviceRequest {
  adDomain?: string(name='AdDomain', description='The domain of the Active Directory (AD) workspace.', example='alpha.lftltd.net'),
  serialNumber?: string(name='SerialNumber', description='The serial number of the virtual MFA device. The serial number is unique for each device.

This parameter is required.', example='dc856334-446b-4035-bfbc-18af261e****'),
}

model RemoveMfaDeviceResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='FB550AAB-FB36-4A91-93F6-F4374AF65403'),
}

model RemoveMfaDeviceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RemoveMfaDeviceResponseBody(name='body'),
}

/**
 * @summary Removes a virtual multi-factor authentication (MFA) device that is bound to a convenience user.
 *
 * @description If you remove a virtual MFA device that is bound to a convenience user, the convenience user can no longer use the virtual MFA device to log on to cloud desktops. Before the convenience user can log on to cloud desktops again, a new virtual MFA device must be bound to the convenience user.
 *
 * @param request RemoveMfaDeviceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RemoveMfaDeviceResponse
 */
async function removeMfaDeviceWithOptions(request: RemoveMfaDeviceRequest, runtime: $RuntimeOptions): RemoveMfaDeviceResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.adDomain)) {
    query['AdDomain'] = request.adDomain;
  }
  if (!$isNull(request.serialNumber)) {
    query['SerialNumber'] = request.serialNumber;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'RemoveMfaDevice',
    version = '2021-03-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Removes a virtual multi-factor authentication (MFA) device that is bound to a convenience user.
 *
 * @description If you remove a virtual MFA device that is bound to a convenience user, the convenience user can no longer use the virtual MFA device to log on to cloud desktops. Before the convenience user can log on to cloud desktops again, a new virtual MFA device must be bound to the convenience user.
 *
 * @param request RemoveMfaDeviceRequest
 * @return RemoveMfaDeviceResponse
 */
async function removeMfaDevice(request: RemoveMfaDeviceRequest): RemoveMfaDeviceResponse {
  var runtime = new $RuntimeOptions{};
  return removeMfaDeviceWithOptions(request, runtime);
}

model RemoveOrgRequest {
  orgId?: string(name='OrgId', description='This parameter is required.', example='org-5yy5icj981xe5****'),
}

model RemoveOrgResponseBody = {
  requestId?: string(name='RequestId', example='6C352609-EE7F-5603-B5E6-57C3EDDD****'),
}

model RemoveOrgResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RemoveOrgResponseBody(name='body'),
}

/**
 * @summary 移除组织
 *
 * @param request RemoveOrgRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RemoveOrgResponse
 */
async function removeOrgWithOptions(request: RemoveOrgRequest, runtime: $RuntimeOptions): RemoveOrgResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.orgId)) {
    body['OrgId'] = request.orgId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'RemoveOrg',
    version = '2021-03-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 移除组织
 *
 * @param request RemoveOrgRequest
 * @return RemoveOrgResponse
 */
async function removeOrg(request: RemoveOrgRequest): RemoveOrgResponse {
  var runtime = new $RuntimeOptions{};
  return removeOrgWithOptions(request, runtime);
}

model RemovePropertyRequest {
  propertyId?: long(name='PropertyId', description='The ID of the property. You can call the [ListProperty](https://help.aliyun.com/document_detail/410890.html) operation to query the property ID.

This parameter is required.', example='390'),
}

model RemovePropertyResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='1CBAFFAB-B697-4049-A9B1-67E1FC5F****'),
}

model RemovePropertyResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RemovePropertyResponseBody(name='body'),
}

/**
 * @summary Deletes a user property.
 *
 * @param request RemovePropertyRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RemovePropertyResponse
 */
async function removePropertyWithOptions(request: RemovePropertyRequest, runtime: $RuntimeOptions): RemovePropertyResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.propertyId)) {
    body['PropertyId'] = request.propertyId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'RemoveProperty',
    version = '2021-03-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes a user property.
 *
 * @param request RemovePropertyRequest
 * @return RemovePropertyResponse
 */
async function removeProperty(request: RemovePropertyRequest): RemovePropertyResponse {
  var runtime = new $RuntimeOptions{};
  return removePropertyWithOptions(request, runtime);
}

model RemoveUsersRequest {
  users?: [ string ](name='Users', description='The usernames of the convenience users that you want to remove.

This parameter is required.', example='test1'),
}

model RemoveUsersResponseBody = {
  removeUsersResult?: {
    failedUsers?: [ 
      {
        endUserId?: string(name='EndUserId', description='The ID of the convenience user that failed to be removed.', example='test2'),
        errorCode?: string(name='ErrorCode', description='The error code.', example='InvalidUsername'),
        errorMessage?: string(name='ErrorMessage', description='The error message.', example='test2 is an invalid username.'),
      }
    ](name='FailedUsers', description='The convenience users that failed to be removed.'),
    removedUsers?: [ string ](name='RemovedUsers', description='The convenience users that were removed.'),
  }(name='RemoveUsersResult', description='The result of removing the convenience user.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='1CBAFFAB-B697-4049-A9B1-67E1FC5F****'),
}

model RemoveUsersResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RemoveUsersResponseBody(name='body'),
}

/**
 * @summary Removes one or more convenience users.
 *
 * @param request RemoveUsersRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RemoveUsersResponse
 */
async function removeUsersWithOptions(request: RemoveUsersRequest, runtime: $RuntimeOptions): RemoveUsersResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.users)) {
    body['Users'] = request.users;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'RemoveUsers',
    version = '2021-03-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Removes one or more convenience users.
 *
 * @param request RemoveUsersRequest
 * @return RemoveUsersResponse
 */
async function removeUsers(request: RemoveUsersRequest): RemoveUsersResponse {
  var runtime = new $RuntimeOptions{};
  return removeUsersWithOptions(request, runtime);
}

model ResetUserPasswordRequest {
  notifyType?: int32(name='NotifyType', description='The method to notify the user after the password is reset.

> Alibaba Cloud accounts of the international site do not support sending notification through text messages.', example='1'),
  users?: [ string ](name='Users', description='The names of the convenience users whose passwords you want to reset.

This parameter is required.', example='test1'),
}

model ResetUserPasswordResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='32D05B39-E6EE-4D7A-9FD0-762A26859D0D'),
  resetUsersResult?: {
    failedUsers?: [ 
      {
        endUserId?: string(name='EndUserId', description='The ID of the convenience user whose password failed to be reset.', example='test123'),
        errorCode?: string(name='ErrorCode', description='The error code.', example='InvalidUsername'),
        errorMessage?: string(name='ErrorMessage', description='The error message.', example='test123 is an invalid username.'),
      }
    ](name='FailedUsers', description='The information about the convenience users whose passwords failed to be reset.'),
    resetUsers?: [ string ](name='ResetUsers', description='The convenience users to which the system sent a password reset email.'),
  }(name='ResetUsersResult', description='The result of resetting the password of the convenience user.'),
}

model ResetUserPasswordResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ResetUserPasswordResponseBody(name='body'),
}

/**
 * @summary Resets the password for a convenience user. If you call this operation, a token that is used to reset the password is generated, and the system sends a password reset email that includes the token to the email address of the convenience user.
 *
 * @param request ResetUserPasswordRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ResetUserPasswordResponse
 */
async function resetUserPasswordWithOptions(request: ResetUserPasswordRequest, runtime: $RuntimeOptions): ResetUserPasswordResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.notifyType)) {
    body['NotifyType'] = request.notifyType;
  }
  if (!$isNull(request.users)) {
    body['Users'] = request.users;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'ResetUserPassword',
    version = '2021-03-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Resets the password for a convenience user. If you call this operation, a token that is used to reset the password is generated, and the system sends a password reset email that includes the token to the email address of the convenience user.
 *
 * @param request ResetUserPasswordRequest
 * @return ResetUserPasswordResponse
 */
async function resetUserPassword(request: ResetUserPasswordRequest): ResetUserPasswordResponse {
  var runtime = new $RuntimeOptions{};
  return resetUserPasswordWithOptions(request, runtime);
}

model SetUserPropertyValueRequest {
  propertyId?: long(name='PropertyId', description='The property ID. You can call the [ListProperty](~~ListProperty~~) operation to query the property ID.

This parameter is required.', example='390'),
  propertyValueId?: long(name='PropertyValueId', description='The ID of the property value. You can call the [ListProperty](~~ListProperty~~) operation to query the ID of the property value.

This parameter is required.', example='978'),
  userId?: long(name='UserId', description='The ID of the convenience user. You can call the [DescribeUsers](~~DescribeUsers~~) operation to query the user ID.

This parameter is required.', example='11'),
  userName?: string(name='UserName', description='The username of the convenience user.

This parameter is required.', example='test'),
}

model SetUserPropertyValueResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='1CBAFFAB-B697-4049-A9B1-67E1FC5F****'),
}

model SetUserPropertyValueResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SetUserPropertyValueResponseBody(name='body'),
}

/**
 * @summary Associates a user property with a convenience user.
 *
 * @param request SetUserPropertyValueRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SetUserPropertyValueResponse
 */
async function setUserPropertyValueWithOptions(request: SetUserPropertyValueRequest, runtime: $RuntimeOptions): SetUserPropertyValueResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.propertyId)) {
    body['PropertyId'] = request.propertyId;
  }
  if (!$isNull(request.propertyValueId)) {
    body['PropertyValueId'] = request.propertyValueId;
  }
  if (!$isNull(request.userId)) {
    body['UserId'] = request.userId;
  }
  if (!$isNull(request.userName)) {
    body['UserName'] = request.userName;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'SetUserPropertyValue',
    version = '2021-03-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Associates a user property with a convenience user.
 *
 * @param request SetUserPropertyValueRequest
 * @return SetUserPropertyValueResponse
 */
async function setUserPropertyValue(request: SetUserPropertyValueRequest): SetUserPropertyValueResponse {
  var runtime = new $RuntimeOptions{};
  return setUserPropertyValueWithOptions(request, runtime);
}

model SyncAllEduInfoResponseBody = {
  code?: string(name='Code', example='200'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='1CBAFFAB-B697-4049-A9B1-67E1FC5F****'),
  success?: boolean(name='Success', example='True'),
}

model SyncAllEduInfoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SyncAllEduInfoResponseBody(name='body'),
}

/**
 * @summary 从钉钉手动同步老师学生信息
 *
 * @param request SyncAllEduInfoRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SyncAllEduInfoResponse
 */
async function syncAllEduInfoWithOptions(runtime: $RuntimeOptions): SyncAllEduInfoResponse {
  var req = new OpenApiUtil.OpenApiRequest{};
  var params = new OpenApiUtil.Params{
    action = 'SyncAllEduInfo',
    version = '2021-03-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 从钉钉手动同步老师学生信息
 *
 * @return SyncAllEduInfoResponse
 */
async function syncAllEduInfo(): SyncAllEduInfoResponse {
  var runtime = new $RuntimeOptions{};
  return syncAllEduInfoWithOptions(runtime);
}

model UnlockMfaDeviceRequest {
  adDomain?: string(name='AdDomain', description='The domain of the Active Directory (AD) workspace.', example='welab.co.id'),
  serialNumber?: string(name='SerialNumber', description='The serial number of the virtual MFA device. The serial number is unique for each device.

This parameter is required.', example='dc856334-446b-4035-bfbc-18af261e****'),
}

model UnlockMfaDeviceResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='9BD39C60-4E38-43BE-BA2F-69136C6C5190'),
}

model UnlockMfaDeviceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UnlockMfaDeviceResponseBody(name='body'),
}

/**
 * @summary Unlocks a virtual multi-factor authentication (MFA) device that is bound to a convenience user.
 *
 * @param request UnlockMfaDeviceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UnlockMfaDeviceResponse
 */
async function unlockMfaDeviceWithOptions(request: UnlockMfaDeviceRequest, runtime: $RuntimeOptions): UnlockMfaDeviceResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.adDomain)) {
    query['AdDomain'] = request.adDomain;
  }
  if (!$isNull(request.serialNumber)) {
    query['SerialNumber'] = request.serialNumber;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'UnlockMfaDevice',
    version = '2021-03-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Unlocks a virtual multi-factor authentication (MFA) device that is bound to a convenience user.
 *
 * @param request UnlockMfaDeviceRequest
 * @return UnlockMfaDeviceResponse
 */
async function unlockMfaDevice(request: UnlockMfaDeviceRequest): UnlockMfaDeviceResponse {
  var runtime = new $RuntimeOptions{};
  return unlockMfaDeviceWithOptions(request, runtime);
}

model UnlockUsersRequest {
  autoLockTime?: string(name='AutoLockTime', description='The date on which the convenience users are automatically locked.', example='2023-03-03'),
  users?: [ string ](name='Users', description='The usernames of the convenience users that you want to unlock.

This parameter is required.', example='test1'),
}

model UnlockUsersResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='023F4EC4-3602-4A3E-A514-4970847D59DB'),
  unlockUsersResult?: {
    failedUsers?: [ 
      {
        endUserId?: string(name='EndUserId', description='The ID of the convenience user that failed to be unlocked.', example='test123'),
        errorCode?: string(name='ErrorCode', description='The error code.', example='InvalidUsername'),
        errorMessage?: string(name='ErrorMessage', description='The error message.', example='test123 is an invalid username.'),
      }
    ](name='FailedUsers', description='The convenience users that failed to be unlocked.'),
    unlockedUsers?: [ string ](name='UnlockedUsers', description='The convenience users that were unlocked.'),
  }(name='UnlockUsersResult', description='The result of unlocking the convenience user.'),
}

model UnlockUsersResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UnlockUsersResponseBody(name='body'),
}

/**
 * @summary Unlocks one or more convenience users.
 *
 * @param request UnlockUsersRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UnlockUsersResponse
 */
async function unlockUsersWithOptions(request: UnlockUsersRequest, runtime: $RuntimeOptions): UnlockUsersResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.autoLockTime)) {
    query['AutoLockTime'] = request.autoLockTime;
  }
  var body : map[string]any = {};
  if (!$isNull(request.users)) {
    body['Users'] = request.users;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'UnlockUsers',
    version = '2021-03-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Unlocks one or more convenience users.
 *
 * @param request UnlockUsersRequest
 * @return UnlockUsersResponse
 */
async function unlockUsers(request: UnlockUsersRequest): UnlockUsersResponse {
  var runtime = new $RuntimeOptions{};
  return unlockUsersWithOptions(request, runtime);
}

model UpdatePropertyRequest {
  propertyId?: long(name='PropertyId', description='The ID of the property that you want to modify. You can call the [ListProperty](https://help.aliyun.com/document_detail/410890.html) operation to query the property ID.

This parameter is required.', example='390'),
  propertyKey?: string(name='PropertyKey', description='The new property name.

This parameter is required.', example='testkey'),
  propertyValues?: [ 
    {
      propertyValue?: string(name='PropertyValue', description='The new property value.', example='testvalue'),
      propertyValueId?: long(name='PropertyValueId', description='The ID of property value that you want to modify. You can call the [ListProperty](https://help.aliyun.com/document_detail/410890.html) operation to query the property value ID.', example='978'),
    }
  ](name='PropertyValues', description='The values of property.'),
}

model UpdatePropertyResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='1CBAFFAB-B697-4049-A9B1-67E1FC5F****'),
  updateResult?: {
    propertyId?: long(name='PropertyId', description='The ID of the property.', example='390'),
    propertyKey?: string(name='PropertyKey', description='The name of the property.', example='testkey2'),
    savePropertyValueModel?: {
      failedPropertyValues?: [ 
        {
          errorCode?: string(name='ErrorCode', description='The error code.', example='ExistedPropertyValue'),
          errorMessage?: string(name='ErrorMessage', description='The error message.', example='The property value is used by another property.'),
          propertyId?: long(name='PropertyId', description='The ID of the property.', example='390'),
          propertyValue?: string(name='PropertyValue', description='The value of the property.', example='testvalue'),
        }
      ](name='FailedPropertyValues', description='The property values that failed to be modified.'),
      savePropertyValues?: [ 
        {
          propertyValue?: string(name='PropertyValue', description='The value of the property.', example='testvalue2'),
          propertyValueId?: long(name='PropertyValueId', description='The ID of the property value.', example='978'),
        }
      ](name='SavePropertyValues', description='The property values that were modified.'),
    }(name='SavePropertyValueModel', description='The result of the property value modification.'),
  }(name='UpdateResult', description='The result of the modification.'),
}

model UpdatePropertyResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdatePropertyResponseBody(name='body'),
}

/**
 * @summary Modifies a user property.
 *
 * @param request UpdatePropertyRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdatePropertyResponse
 */
async function updatePropertyWithOptions(request: UpdatePropertyRequest, runtime: $RuntimeOptions): UpdatePropertyResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.propertyId)) {
    body['PropertyId'] = request.propertyId;
  }
  if (!$isNull(request.propertyKey)) {
    body['PropertyKey'] = request.propertyKey;
  }
  if (!$isNull(request.propertyValues)) {
    body['PropertyValues'] = request.propertyValues;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateProperty',
    version = '2021-03-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Modifies a user property.
 *
 * @param request UpdatePropertyRequest
 * @return UpdatePropertyResponse
 */
async function updateProperty(request: UpdatePropertyRequest): UpdatePropertyResponse {
  var runtime = new $RuntimeOptions{};
  return updatePropertyWithOptions(request, runtime);
}

